{% extends "_layout.html" %}
{% import "component/pagination.njk" as pagination %}
{% import "component/table.njk" as table %}
{% import "component/search.njk" as search %}

{# 样式代码 #}
{% block style %}

{% endblock %}

{# bodyd代码#}
{% block body %}
<div class="wrapper wrapper-content">
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">

            <div class="ibox-content">
                <div class="row">
                    <div class="col-sm-10">
                        <form class="page-search-form">
                        </form>
                    </div>
                    <div class="col-sm-2">
                        <div class="ibox-tools">
                            <a href="/printer/edit" class="btn btn-info btn-xm">添加打印机</a>
                        </div>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="table-responsive">
                   <form id="table-form">
                       <table class="table table-striped">
                           <thead>
                           <tr>
                              <th></th>
                              <th>打印机名称</th>                        
                              <th>编号(SN)</th>
                              <th>状态</th>
                              <th>在线</th>
                              <th>操作</th>
                           </tr>
                           </thead>
                           <tbody>
                           {% for item in data.list %}
                               <tr>
                                   <td>
                                       <input type="checkbox" value="{{ item.id }}" class="i-checks" name="check">
                                   </td>
                                   <td>{{item.name}}</td>
                                   <td>
                                       {% if item.status == 1 %}
                                           正常
                                           {% elif item.status == 2 %}
                                           禁用
                                       {% else %}
                                           未知
                                       {% endif %}
                                   </td>
                                   <td>{{item.username}}</td>
                                   <td>{{item.mobile}}</td>
                                   <td>
                                       {% if item.sex == 1 %}
                                           男
                                       {% elif item.sex == 0 %}
                                           女
                                       {% else %}
                                           未知
                                       {% endif %}
                                   </td>
                                   <td>
                                       {% if item.type == 1 %}
                                           老板
                                           {% elif item.type == 2 %}
                                           员工
                                       {% else %}
                                           未知
                                       {% endif %}

                                   </td>
                                   <td>{{item.lastLoginTime}}</td>
                                   <td data-id="{{ item.id }}">
                                       <a href="/printer/edit?id={{item.id}}">编辑</a>
                                       {% if item.id != '1' %}
                                           <a class="del" data-id="{{ item.id }}" data-href="/printer/delete">删除</a>
                                       {% endif %}
                                   </td>
                               </tr>
                           {% else %}
                               暂无数据
                           {% endfor %}
                           </tbody>
                       </table>
                   </form>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="btn-region clearfix">
                    <div class="pull-left">
                        <button href="" id="batch-del-btn" class="btn btn-danger btn-sm js-batch" data-url="/printer/delete" data-confirm="确定删除选中的打印机吗?" data-original-title="" title="">批量删除</button>
                    </div>
                    <div class="pull-right">
                        {{ pagination.pagination(data, params, '/printer') }}
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
</div>
{% endblock %}

{#js代码#}
{% block js %}
<script>


</script>

{% endblock %}
